The citizens of Springfield dress in their Halloween costumes for a costume contest. Dr. Hibbert is declared second placed victor. The first place winner is a strange old witch. She is given the award and is asked who she is. She is therefore forced to admit that she is a real witch. The reason why she even went to the contest to compete is unknown. As a result, her reward is rescinded because she is not in actual costume. In anger, she turns everyone into their costumed characters and glides away on her broom.
The only person who can reverse the spell is Maggie, who was costumed as a witch, and now really is one. Half the townspeople want to be turned back into their normal selves (those who were dressed in costumes of horrible monsters, such as Ned Flanders, who was turned into a flower and the Bumblebee Man as a giant bee is obsessed with him, Marge, who became a skeleton), Homer is beheaded but alive and can't drink beer without spilling it. While the other half wants to stay as they are (those whose costumes actually improved their lives, e.g. Bart, who has become a werewolf, Millhouse is bulldozer with his head, Moe, turning into Hugh Hefner which attracts women to Moe, and Sideshow Mel, turning into Spider-Man).
Maggie then turns them all, including Dennis Rodman, into pacifiers with their normal heads for no apparent reason other than her obsession for pacifiers, and flies off on a broom to the theme tune of the television series Bewitched.